a_ticket_reply_without_a_length_ends_without_waiting_for_the_timeout failed
now and then on a busy machine. Its server stopped reading at the end of the
request's headers and closed right after its reply. When the request's body
arrived after that read, the connection was closed with data unread, which
resets it, and the client got an error instead of the reply (os error 22 on
macOS).
The server now reads the body the request's Content-Length announces before
it replies. tickets_call is not touched.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gr84VuQWHKtTwJ7cC3CP3W
Change
Fixes #20077.
tickets_http_tests::a_ticket_reply_without_a_length_ends_without_waiting_for_the_timeoutfailed now and then on a busy machine. The fault was in the test's own server, so only the test changes.The cause. The test's server stopped reading at the end of the request's headers, wrote its reply and closed. The request also has a two-byte body. When that body arrived after the server's read, the connection was closed with data unread, which resets it, and the client got an error instead of the reply:
io: Invalid argument (os error 22)on macOS.The fix. The server now reads the body the request's
Content-Lengthannounces before it replies.tickets_callis not touched.What I measured on an Apple M6, running the one test in its test binary:
A correction to the issue. I wrote there that the same race might hit real problem reports. With the cause known that is unlikely: it needs a server that closes with part of the request unread.
PR #19457 notes this test failing under load on Windows with os error 10053. I expect the same cause there but have not run it on Windows.
Changes a default: no
Validation
On macOS (Apple M6), on main 6162640:
cargo xtask ci: the format, asset, icon, licence, list, skill and layer checks pass; its shared-crate step then stops at the Metal test of issue Tests:the_views_passes_are_timed_only_while_the_readout_asksfails on Apple Silicon (Metal), socargo xtask cistops at the shared-crate step #19342, which fails on main on this Mac (PR Frame-rate readout: a still view gets its GPU time on Apple GPUs, where a timer's first frame reads back empty #20046 fixes it). So I ran the gates after it one by one.ui-containers,mesh-decisions, clippy with-D warnings, the wasm check (33 crates), the doc tests andweb-offline-testpass.tests/KNOWN_FAILING_TESTS, the Metal test of issue Tests:the_views_passes_are_timed_only_while_the_readout_asksfails on Apple Silicon (Metal), socargo xtask cistops at the shared-crate step #19342, andcmd::drawing::tests::save_as_keeps_drawing_sources_through_undo_redo_and_checkpoints,cmd::sheet::dxf_tests::byte_regressions::flat_export_preserves_original_bytes,native_cad::usd::tests::exact_reads_a_brep_it_cannot_build_as_its_meshandblend::tests::concave_chord_and_g2_rounds_run_on_past_where_their_face_turns_into_a_round.solidcore/is not touched, so its tests were not run.Screenshots of the behavior (when observable)
None: a test's own server changes, nothing a user can see.
Integration status
Based on main 6162640; one commit, 10 lines added and 1 removed inside this one test. Main has moved by two commits since, and the branch still merges without conflicts.
PR #16458 and PR #19594 also edit
apps/solidcraft/src/main.rs, in other places (neither touches this test).Summary by CodeRabbit